defmodule IocpMonitor.Server.Supervisor do
  @moduledoc """
  TCP服务进程的监护进程定义模块
  """

  use Supervisor

  @spec start_link(integer()) :: :ok | {:error, term()}
  def start_link(port) do
    Supervisor.start_link(__MODULE__, port, name: __MODULE__)
  end

  @impl true
  def init(port) do
    children = [
      {IocpMonitor.Server, port}
    ]
    Supervisor.init(children, strategy: :one_for_one)
  end
end